home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
magazine
/
dbms_mag
/
9104
/
techtip1.apr
< prev
next >
Wrap
Text File
|
1991-03-26
|
1KB
|
69 lines
Listing 1
* Listing 1A
* For dBASE IV, FoxPro, Clipper
*
* In Clipper, replace the ON KEY LABEL command with
* SET KEY <expn> TO [procedure]
PUBLIC exit_read
STORE .f. TO exit_read
ON KEY LABEL F2 DO ExitLoop
.
.
.
* Data entry @ SAY/GETS here
.
.
.
DO WHILE .NOT. exit_read
READ SAVE
ENDDO
* Put the rest of your data entry code here
PROCEDURE ExitLoop
STORE .t. TO exit_read
KEYBOARD <appropriate key code for Page Down>
* Listing 1B
* For Sophco╒s Force
VARDEF
LOGICAL exit_read = .f.
ENDDEF
PROCEDURE data_entry
ON KEY DO check_key_stroke && acts as a keystroke filter
.
.
.
* Data entry @ SAY/GETS here
.
.
.
DO WHILE .NOT. exit_read
READ SAVE
ENDDO
* Put the rest of your data entry code here
ENDPRO
FUNCTION check_key_stroke
VARDEF
UINT TheKey
ENDDEF
TheKey = Lastkey()
DO CASE
CASE TheKey = &K_F2
exit_read = .t.
RETURN 0 && Ignore this keystroke
<Other filter conditions here>
OTHERWISE
RETURN TheKey && Pass the keystroke thru
ENDCASE
ENDPRO